\documentclass[a4paper,twoside]{report}

\providecommand{\coursename}{Design and Implementiation of Mobile Applications}
\providecommand{\projecttitle}{TestBusterSimulator}
\providecommand{\annoacc}{2013-2014}
\providecommand{\adviser}{Prof. Luciano Baresi}
\providecommand{\firstauthor}{Stefano Paladino}
\providecommand{\firstauthorid}{799576}
\providecommand{\secondauthor}{Riccardo Tommasini}
\providecommand{\secondauthorid}{799120}
\providecommand{\tbsubtitle}{}
\author{\firstauthor, \secondauthor}

\usepackage[margin=3cm]{geometry} % margins for the TITLE page...
% this is needed as the geometry is changed by the title page
\AtBeginDocument{\newgeometry{top=3.5cm,bottom=3.5cm,right=3.5cm,left=3.5cm}}

\usepackage[utf8]{inputenc}
\usepackage[italian,english]{babel}

\usepackage{graphicx}
\usepackage{booktabs}

\usepackage{listings}
\lstset{columns=fullflexible}

\lstset{	basicstyle=\ttfamily,
			keywordstyle=\bfseries\color{blue},
			commentstyle=\bfseries\color{blue!20!black!50!green}
}

\usepackage{lmodern} % latin modern for sans serif && typewriter text
\usepackage{charter}

\usepackage[T1]{fontenc}

\usepackage[pdfusetitle, colorlinks, linkcolor=black, urlcolor=black]{hyperref}

% Definizione intestazioni e pie' di pagina
\usepackage{fancyhdr}
\AtBeginDocument{
	\pagestyle{fancy}
	\fancyhf{}
	\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{}}
	\renewcommand{\sectionmark}[1]{\markright{\MakeUppercase{#1}}{}}
	\renewcommand{\headrulewidth}{0pt}
	\makeatletter
	\fancyhead[LE]{\textbf{\thepage}\hspace{2em}\footnotesize{
		\MakeUppercase{\coursename}}
	}
	\makeatother
	\fancyhead[RO]{{\footnotesize\leftmark}\hspace{2em}\textbf{\thepage}}
	\fancyhead[RE, LO]{}
	\fancypagestyle{plain}{
		\fancyhf{}
		\renewcommand{\headrulewidth}{0pt}
	}
}

%% Cambia il carattere delle didascalie delle figure %%
\usepackage[font=small,format=plain,labelfont=bf,up,textfont=it,up]{caption}
%%% Cambia il carattere dei titoli di sezione %%
\usepackage{titlesec}
\titleformat{\section}{\Large\bfseries\sffamily}{\thesection}{1em}{}
